#!/usr/bin/zsh -feux

# `very-old':
# .git/mmc/sum1 contained:
#
# branch name 1
# ..
# branch name N

# ...And this program `converted' that information into the new REPRESENTATION.
# not yet calling the now existing API.

source /usr/share/git-hierarchy/functions.sh
GIT_DIR=$(git_dir)
SUM_DIR=$GIT_DIR/mmc


foreach sum ($SUM_DIR/*(:t))
{
    echo $sum
    # recreate it:
    i=1
    foreach addend ($(cat $SUM_DIR/$sum))
    {
	ref=refs/sums/$sum/$i
	git symbolic-ref $ref \
	    $(git show-ref refs/heads/$addend | head -n 1| cut -f 2 -d ' ')
	# this gives the canonic ref name.
	((i=i+1))
    }
}


